<template>
  <div class="dmform dmform-right" v-loading="loading">
    <div class="dmform-groups" style="padding-top: 10px;" :style="{maxHeight:pageHeight+'px'}">
      <div class="dmform-group" style="padding: 10px; margin-bottom: 10px;">
        <a-form-model-item help="1、企业所拥有的角色，决定了企业可以使用的功能？2、企业管理员为员工授权时，只能从企业所拥有的角色中选择。">
          <TreeTransfer
              left-data-url="/jsofted/role/tree"
              right-add-url="/jsofted/tenantRole/add"
              right-delete-url="/jsofted/tenantRole/deleteBy"
              leftField="tenantId"
              rightField="roleId"
              :leftValue="pageParams.id"
              left-title="可以选择的角色"
              right-title="企业拥有的角色"
          >
          </TreeTransfer>
        </a-form-model-item>
      </div>
    </div>
  </div>
</template>
<script>
import DataFormUtils from '@/utils/DataFormUtils'

export default {
  components: { },
  mixins: [DataFormUtils],
  data() {
    return {
      loadUrl: '/jsofted/tenant/get/',
      updateUrl: '/jsofted/tenant/update/',
      formData: {
        id: '',
        name: '',
        roleTypes: {},
      },
    }
  },
  methods: {
    initFormData(obj) {
      obj = obj || {}
      this.formData.id = obj.id || ''
      this.formData.name = obj.name || ''
      this.formData.roleTypes = obj.roleTypes || {}
    },
  }
}
</script>
